package com.ofood.data.handler;

import com.ofood.data.exception.CustomException;
import com.ofood.result.BaseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;

@RestControllerAdvice
public class CustomExtHandler {
    @ExceptionHandler(value = CustomException.class)
    BaseResult handleException(CustomException e, HttpServletRequest request){
        return e.getBaseResult();
    }
}
